package cn.tedu;

import java.sql.Connection;
import java.sql.SQLException;
import java.sql.Statement;
import java.util.Scanner;

public class Demo02 {
    public static void main(String[] args) {
        Scanner sca = new Scanner(System.in);
        System.out.println("输入英雄名:");
        String bear = sca.nextLine();
        System.out.println("输入价格");
        int sal = sca.nextInt();

        try (
                Connection conn = DBUtils.getConn()
        ){
            Statement s = conn.createStatement();
            s.executeUpdate(
            "insert into hero values (null,'"+bear+"','"+sal+"')");
        } catch (SQLException throwables) {
            throwables.printStackTrace();
        }
    }
}
